<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=5.0" charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		
		
		<link type="text/css" rel="stylesheet" href="../css/top.css" />
		<link type="text/css" rel="stylesheet" href="../css/mall_mysave.css" />
		
		<script type="text/javascript" src='../js/model/jquery-2.1.4.min.js'></script>
		<script type="text/javascript" src="../js/layer/layer.js"></script>
		<script type="text/javascript" src="../js/model/reset_font.js"></script>
		
		<title >优当借书</title>
		<script>
			window.onload=function(){
				$("body").css("opacity",1);
			}
		</script>
	</head>
	<body >
		<div class="top" style="background: #FFFFFF;">
			<a href="#" class="goback">
				<img src="../images/icons/goback2.png" />
			</a>
			<span>我的收藏</span>
		</div>
		<div class="isnone" style="display: none;">
			<img src="../images/mall_mysave/isnone.png" class="isnonePic"  />
			<div>暂时没有商品哦</div>
		</div>
		<div class="main" >
			
			<div class="item" id="001">
			<a href="#" class="item_con">
				<img src="../images/books/book.png" class="bookPic" />
				<div class="item_right">
					<img src="../images/mysave/delPic.png" class="delPic"  />
					<div class="bookname">死亡笔记1死亡笔记1死亡笔记1死亡笔记1死亡笔记1死亡笔记1</div>
					
					<div class="price">￥<span>128</span></div>
				</div>
				<div class="clear"></div>
			</a>
			</div>
			
			<div class="item" id="001">
			<a href="#" class="item_con">
				<img src="../images/books/book.png" class="bookPic" />
				<div class="item_right">
					<img src="../images/mysave/delPic.png" class="delPic"  />
					<div class="bookname">死亡笔记1死亡笔记1死亡笔记1死亡笔记1死亡笔记1死亡笔记1</div>
					
					<div class="price">￥<span>128</span></div>
				</div>
				<div class="clear"></div>
			</a>
			</div>
		</div>
		
		<div class="grey" style="display: none;">
			<div class="whiteboard">
				<div class="wb_top">
					确认删除商品？
				</div>
				<div class="wb_bot">
					<div class="cancel">取消</div>
					<div class="comfirm">确认</div>
				</div>
			</div>
		</div>
		<input type="hidden" class="delId" value=""  />
		
		<script>
			$(function(){
				$(".item_con").on({
					"touchstart":function(){
						$(this).css("background","#F5F5F5")
					},"touchend":function(){
						$(this).css("background","#FFFFFF")
					},"click":function(){
						event.stopPropagation();
						
					}
				})
				
				$(".delPic").click(function(){
					var delid=$(this).parent().parent().parent().attr("id");
					$(".delId").val(delid);console.log($(".delId").val());
					$(".grey").show();
				})
				
				$(".delPic").on({
					"touchstart":function(){
						$(this).css("opacity","0.5");
					},
					"touchend":function(){
						$(this).css("opacity","1");
					},"click":function(){
						event.stopPropagation();
						event.preventDefault();
					}
				})
				
				
				
				$(".cancel").on({
					"touchstart":function(){
						$(this).css("background","#F5F5F5")
					},"touchend":function(){
						$(this).css("background","#FFFFFF")
					},"click":function(){
						$(".grey").hide();
					}
				})
				
				$(".comfirm").on({
					"touchstart":function(){
						$(this).css("background","#885736")
					},"touchend":function(){
						$(this).css("background","#A06E4D")
					},"click":function(){
						$(".grey").hide();
					var delid=$(".delId").val();
					$("#"+delid).remove();
					changeType();
					}
				})
				
				
				
				
			})
			function changeType(){
				var num=$(".item").length;
				if(num<1){
					$(".main").hide();
					$(".isnone").show();
				}else{
					$(".main").show();
					$(".isnone").hide();
				}
			}
		</script>
	</body>
</html>
